Session Types
Purpose
This example shows the use of sessions and illustrates:
- TROEventSessionManager
- TROInMemorySessionManager
- TROMasterServerSessionManager
- TRODBSessionManager
Getting Started
- Build or compile all projects.
- Launch the server (via the menu option: RemObjects | Launch Server Executable).
- Activate the session desired.
- Ensure that SessionTypes_Client is the selected project and run it.
Examine the Code
-
Examine the simple code needed for changing the session in SessionTypes_ServerMain.pas.
Important note: this sample needs a "Sessions" table to be created in one of your databases. By default, the sample looks for the Sessions table in MSSQL's Northwind Database, but you can easily change to connect to any other database.
To create the Sessions table, run the .SQL script provided:
..\RemObjects SDK for Delphi\Samples\Session Types\SessionTypes Create Session Table.sql
using the appropriate query tool provided with your database (e.g. Query Analyzer for MSSQL).
Data Abstract Users
This sample can easily be extended to encompass Data Abstract via the following steps:
- Create TDAConnectionManager, TDADriverManager, TDAADODriver and TDASchema instances.
- Relink.
- In the schema, create the datasets and commands similar to qu* (TADOQuery).
- Create a DADBSessionManager instance and assign the corresponding datasets and commands.